import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np

fig, ax = plt.subplots()

# a Locator instance
months = mdates.MonthLocator()
# a Formatter instance
dateFmt = mdates.DateFormatter("%m/%d/%y")

# format the ticks
ax.xaxis.set_major_formatter(dateFmt)